package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/admin/apis"
	"tuowei.com/common/actions"
	"tuowei.com/common/middleware"
)

func init() {
	routerCheckRole = append(routerCheckRole, registerSysCourseWareRouter)
}

// 需认证的路由代码
func registerSysCourseWareRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.SysCourseWare{}
	r := v1.Group("/sys-course-ware").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
	{
		//r.GET("", api.C)
		r.GET("/:id", api.Get)
		r.POST("", api.Insert)
		r.PUT("/update", api.Update)
		r.PUT("", api.UpdateCourseWare)
		r.DELETE("", api.DeleteCourseWare)
		r.DELETE("/all/:id", api.DeleteLargeChapter)
	}

}
